package com.lzx.adx.report.util;

import com.alibaba.fastjson.JSONObject;
import com.lzs.adx.commmon.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.ResponseEntity;

import java.util.Objects;
import java.util.Random;

@Slf4j
public class AdPerUtil {


    /**
     * 扣回传功能
     * @param per
     * @return
     */
    public static boolean randomPer(Double per) {
        Random random = new Random();
        double randomValue = random.nextDouble(); // 生成到1之间的随机数
        log.info("随机数为{}", randomValue);
        return randomValue < per;
    }

}
